// WP3Doc.h : interface of the CWP3Doc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_WP3DOC_H__C63B7CFE_AADA_41C3_A2F4_F1D44FBD5D06__INCLUDED_)
#define AFX_WP3DOC_H__C63B7CFE_AADA_41C3_A2F4_F1D44FBD5D06__INCLUDED_

#include "PaintElement.h"	// Added by ClassView
#include "SettingsDialog.h"	// Added by ClassView
#include "ElementManager.h"	// Added by ClassView

#include "ExpFuse.h"	// Added by ClassView


#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000



#ifdef _DEBUG
#define WP3_FILE_HEADER "WP3_DEBUG_FILE"
#else
#define WP3_FILE_HEADER "WP3FILE"
#endif








class CWP3Doc : public CDocument
{
protected: // create from serialization only
	CWP3Doc();
	DECLARE_DYNCREATE(CWP3Doc)

// Attributes
public:
	
typedef CTypedPtrList <CPtrList,CPaintElement*> CPaintElementList;

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CWP3Doc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	//}}AFX_VIRTUAL

// Implementation
public:
	int GetCurrentDesktopColorDepth();
	BOOL IsChanged();
	BOOL AskAboutSave();

	void PaintFrame(CDC* pdc,CPaintElement* pEl);
	void InsertElementFromToolbar(CString FileName);
	void ChangeZOrder(CPaintElement *pEl, BOOL isToFront);

	CPaintElement* m_pActiveElement;
	BOOL MakeBMP();
	BOOL LoadDocument(CString FileName);
	CPaintElement* CloneElement(CPaintElement* pEl);
	void ProcessProfileSettings();
	void PlaceElement(CPaintElement* pEl,BOOL isToFront);
	void DeleteElement(CPaintElement * pEl);
	void UpdateView();
	COLORREF m_BGcolor;
	COLORREF m_Fcolor;
	BOOL WriteDIB(LPTSTR szFile, HANDLE hDIB);
	void ReadProfileSettings();
	CString m_BMPFileName;
	int m_PaperWidth,m_PaperHeight;
	BOOL m_isSetWP;
	BOOL m_isAutoLoad;
	BOOL m_isFirstLoad;
	CBrush* m_pBrush;
	BOOL m_isAutomation;
	BOOL m_isChanged;

	

	CPaintElement* FindElement(CPoint point);
	void ClearElements();
	void PaintElements(CDC* pdc);
	CPaintElement* AddElement(CString DllFileName);
	virtual ~CWP3Doc();
	CPaintElementList m_ellist;
	

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	HANDLE DDBToDIB(CBitmap &bitmap, DWORD dwCompression, CPalette *pPal);
	//{{AFX_MSG(CWP3Doc)
	afx_msg void OnButtonSettings();
	afx_msg void OnButtonMakeBMP();
	afx_msg void OnButtonAddElement();
	afx_msg void OnButtonElmanage();
	afx_msg void OnButtonAddDay();
	afx_msg void OnButtonAddMon();
	afx_msg void OnButtonAddPic();
	afx_msg void OnButtonAddRem();
	afx_msg void OnButtonAddGeo();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_WP3DOC_H__C63B7CFE_AADA_41C3_A2F4_F1D44FBD5D06__INCLUDED_)
